package character;

import java.io.File;

import org.newdawn.slick.Animation;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.SpriteSheet;

import stages.Snow;
import attack.snowman.SnowManAttackGetter;
import framework.BasicFighter;
import framework.C;
import framework.NartanAnimationManager;
import framework.Util;

public class Snowman extends BasicFighter {

	public Snowman() {
		Image sprite = null;
		setWidth(400);
		setHeight(200);		
		try {
			sprite = new Image(C.ASSETS_CHAR_FOLDER + "Snowman" + File.separator + "sprites.png");
		} catch (SlickException e) {
			e.printStackTrace();
		}
		SpriteSheet sprites = new SpriteSheet(sprite, 384, 192, 0, 0);
		this.animations = new NartanAnimationManager(sprites) {
			@Override
			public void initWalkingAnimation() {
				Image[] frames = new Image[2];
				frames[0] = getSpriteSheet().getSprite(1, 0);
				frames[1] = getSpriteSheet().getSprite(2, 0);
				this.walkingAnimation = new Animation(frames, 100);
				this.walkingAnimationBackward = Util.getFlippedAnimation(this.walkingAnimation, true, false);
			}
		};
		this.attacks = new SnowManAttackGetter(this);
		setStage(new Snow());
	}

	@Override
	public String getFighterName() {
		return "Drazzilb";
	}
}
